<?php
if(!defined('NEED_PERMISSION'))
{
	define('NEED_PERMISSION','ADMIN');
}
$allowAccess = FALSE;
$needPermission = constant('NEED_PERMISSION');
switch($needPermission)
{
	case 'ADMIN':
	if(SessionUtil::isExistVar(constant('SESSION_KEY_USER_ID')))
	{
		$allowAccess = TRUE;
	}
	break;
	case 'NONEEDLOGIN':
		$allowAccess = TRUE;
	break;
}
//check permession
if($allowAccess !== TRUE)
{
	ob_clean();
	header('Location:index.php');
	exit();
}